Constant bitrate real-time lossless audio decoding method restoring moved excess coded data amounts

ABSTRACT

A lossless decoding method that restores losslessly compression encoded audio data on a real-time basis. The encoded audio data is divided into first data having a data amount exceeding the maximum bitrate and second data having a data amount less than the maximum bitrate, where the first data is divided into third data being the encoded audio data having a data amount of the maximum bitrate and fourth data being the encoded data of the portion exceeding the maximum bitrate, and where the encoded audio data is output so that the fourth data is output together with the second data. The method includes buffering the fourth data in a buffer, combining the buffered fourth data with the corresponding third data, and outputting the combined third and fourth data as restored audio data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of application Ser. No. 09/304,264, filed May 6, 1999, now U.S. Pat. No. 6,385,587, which claims the benefit of Korean Application No. 98-16182, filed May 6, 1998, in the Korean Patent Office, the disclosures of which are incorporated herein by reference. This application is related to co-pending U.S. Pat. application Ser. Nos. 09/588,755, 09/907,965, and 09/907,966.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a lossless encoding and decoding system, and method therefore, and more particularly, to a lossless encoding and decoding system including a lossless encoding apparatus and a lossless decoding apparatus in which encoded data can be decoded on a real-time basis.

2. Description of the Related Art

In general, a digital audio signal is obtained from an analog audio signal by means of a pulse code modulation method, in order to represent audio information with the number of channels, the number of bits and a sampling frequency according to DVD-audio standards. However, since a digital audio signal includes redundancy data, it is required to use lossless compression encoding methods, in order to shorten a recording time of a digital audio signal with respect to a digital versatile disc (DVD) and improve a bitrate.

A representative example of lossless compression encoding methods is the Huffman coding method, in which input data having a higher frequency of occurrence is assigned with a relatively shorter length of codeword and input data having a lower frequency of occurrence is assigned with a relatively longer length of codeword. In the case that a digital audio signal is losslessly compressed by the Huffman coding method, it is more efficiently coded than in the case that only a linear pulse code modulation (PCM) method is used.

Meanwhile, a predictor is used in the case that input data has predictable properties. The predictor determines prediction data corresponding to new input data using previous input data, and th en uses a method for compressing a difference between th e prediction data and the new input data. In the case that such a predictor is additionally used in the above-described lossless compression unit, an encoding efficiency with respect to the digital audio signal can be further enhanced.

When the above-described conventional lossless encoding method is used, a bitrate of the encoded data varies according to the degree of the property and randomness of input data, although a bitrate of the input data is constant. Thus, since conventional lossless coding methods require a very large capacity of buffers, in the case of data compression and decompression, it is difficult to encode or decode data in real-time. In addition, although a buffer capacity is increased in order to solve the above problem, a delay in decoding still remains.

SUMMARY OF THE INVENTION

To solve the above problems, it is an object of the present invention to provide a lossless encoding apparatus for encoding data on a real-time basis.

It is another object of the present invention to provide a lossless decoding apparatus for decoding encoded data on a real-time basis.

It is still another object of the present invention to provide a lossless encoding and decoding system having a lossless encoding apparatus and a lossless decoding apparatus in which encoded data can be decoded on a real-time basis.

Additional objects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.

To accomplish the above and other objects of the present invention, there is provided a lossless encoding apparatus for encoding input audio data, comprising an input buffer to store the input audio data; a lossless compression unit to losslessly compression encode the audio data stored in the input buffer in units of predetermined data and output the encoded audio data in sequence; an output buffer to store the encoded audio data output from the lossless compression unit; and a bitrate controller to distinguish each predetermined data unit of the encoded audio data stored in the output buffer as first data having a data amount exceeding a maximum bitrate or second data having a data amount less than the maximum bitrate, dividing the first data into third data being the encoded audio data having a data amount of the maximum bitrate and fourth data being the encoded data of a portion of the first data exceeding the maximum bitrate, and control the output buffer so that the fourth data is output together with the second data from the output buffer.

To further accomplish the above and other objects of the present invention, there is provided a lossless decoding apparatus to decode input data to restore audio data, comprising an input buffer to store the input audio data and maintain an input sequence thereof; a lossless restorer to losslessly restore the input audio data output from the input buffer, to generate the restored audio data; a buffer controller to control the input buffer, so that first data having no identification information among the input audio data stored in the input buffer is supplied to the lossless restorer and second data having identification information is combined with third data having the same identification information and supplied to the lossless restorer, wherein the first data has a data amount by which a result obtained by lossless encoding of the input audio data of a predetermined data unit does not exceed a maximum bitrate, and the second data and third data form fourth data by which a result obtained by lossless encoding of the input audio data of a same predetermined data unit exceeds the maximum bitrate, and wherein the second data is encoded audio data having a data amount of the maximum bitrate among the fourth data and the third data is encoded audio data of the portion exceeding the maximum bitrate among the fourth data; and an output buffer to store and output the restored audio data generated in the lossless restorer.

To still further accomplish the above and other objects of the present invention, there is provided a lossless encoding and decoding system for encoding and decoding input audio data, comprising a lossless encoding apparatus comprising a first input buffer to store the input audio data, a lossless compression unit to losslessly compression encode the audio data stored in the first input buffer in units of predetermined data and output the encoded audio data in sequence, a first output buffer to store the encoded audio data output from the lossless compression unit, and a bitrate controller to distinguish each predetermined data unit of the encoded audio data stored in the output buffer as first data having a data amount exceeding a maximum bitrate or second data having a data amount less than the maximum bitrate, dividing the first data into third data being the encoded audio data having a data amount of the maximum bitrate and fourth data being the encoded data of a portion of the first data exceeding the maximum bitrate, add identification information to the third data and fourth data to indicate which of the third data and fourth data are from the same predetermined data units, and control the first output buffer so that the fourth data is output together with the second data from the first buffer, and the second through fourth data are output as a bitstream, and a lossless decoding apparatus comprising a second input buffer to store the bitstream in a same input sequence thereof, a lossless restorer to losslessly restore the bitstream output from the second input buffer, generate the input audio data, a buffer controller to control the second input buffer so that the second data having no identification information among the data stored in the second input buffer is supplied to the lossless restorer and the third data and fourth data having the same identification information are combined and supplied to the lossless restorer, a second output buffer to store and output the restored input audio data generated in the lossless restorer.

BRIEF DESCRIPTION OF THE DRAWINGS

The above objects and other advantages of the present invention will become more apparent by describing in detail the structures and operations of the present invention with reference to the accompanying drawings, in which:

FIG. 1 is a block diagram showing a lossless encoding apparatus according to an embodiment of the present invention;

FIG. 2 is a conceptional view for explaining the operation of a bitrate controller shown in FIG. 1;

FIG. 3 shows a structure of a bitstream output from an output buffer shown in FIG. 1; and

FIG. 4 is a block diagram showing a lossless decoding apparatus corresponding to the lossless encoding apparatus shown in FIG. 1.

DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT

A preferred embodiment of the present invention will be described with reference to the accompanying drawings, in which elements having the same reference numerals perform the same functions.

In FIG. 1 showing a lossless encoding apparatus according to an embodiment of the present invention, an input buffer 11 stores digital audio data input from an external source and supplies the stored audio data to a lossless compression unit 13 in the same sequence as its input sequence. The lossless compression unit 13 losslessly compresses and encodes the audio data supplied from the input buffer 11 in each of predetermined data units. In this embodiment of the present invention, for example, a frame is used as a predetermined data unit. Also, the lossless compression unit 13 losslessly compresses and encodes the audio data by means of a lossless compression encoding method such as a well-known Huffman encoding method. The audio data encoded by the lossless compression unit 13 is input to an output buffer 15. The output buffer 15 stores the input encoded audio data. The output buffer 15 stores the encoded audio data in such a pattern that the encoded audio data corresponding to a random frame can be distinguished from the encoded audio data corresponding to the other frames. A bitrate controller 17 stores a maximum bitrate determined based on a bitrate resulting from losslessly encoding all of the audio data corresponding to an audio track of a recording storage medium such as a DVD. The bitrate controller 17 controls the output buffer 15 in such a manner that the encoded audio data stored in the output buffer 15 is output at an output bitrate which is equal to or less than the maximum bitrate.

Referring to FIG. 2, the operation of the bitrate controller 17 will be described below. The bitrate controller 17 distinguishes each frame of the encoded audio data stored in the output buffer 15 into first data having a data amount exceeding the maximum bitrate or second data having a data amount not exceeding the maximum bitrate. By the above division, for example, the encoded audio data of the frames of frame numbers 6, 7 and 10 shown in FIG. 2 is defined as first data. The bitrate controller 17 divides respective first data into third data being the encoded audio data having a data amount of the maximum bitrate and fourth data being the encoded audio data of the portion exceeding the maximum bitrate. The fourth data is shown as hatched portions in FIG. 2. The bitrate controller 17 adds identification information by which the fourth data and the third data corresponding to the fourth data can be distinguished from data of the other frames, to the fourth data and the third data corresponding to the fourth data. Then, the bitrate controller 17 controls the output buffer 15 in such a manner that the fourth data is output together with the second data of the other frame from the output buffer 15. The bitrate controller 17 determines the second data to which the fourth data is added, so that the combined data does not exceed the maximum bitrate.

In this embodiment of the present invention, the bitrate controller 17 selects a particular frame temporally preceding the frame of the fourth data, and controls the output buffer 15 in such a manner that the fourth data is output together with the second data of the selected (other) frame. In this case, the bitrate controller 17 selects a preceding frame in which to add the fourth data based on the bitrate corresponding to a number of frames preceding the frame of the fourth data. In response to the control of the bitrate controller 17, the output buffer 15 outputs the second data, both the second and fourth data, or the third data in the form of a bitstream, in correspondence to a respective frame of the encoded audio data supplied from the lossless compression unit 13. Thus, in the case of the frames having the numbers shown in FIG. 2, the output buffer 15 outputs a bitstream as shown in FIG. 3, wherein the bitstream may be recorded on a recording medium such as a DVD. In FIG. 3, the frames which are not hatched are frames output from the output buffer 15 in the same sequence as that input to the output buffer 15 from the lossless compression unit 13, and the hatched portions show the fourth data added to the second data of a frame temporally preceding the original frame.

FIG. 4 is a block diagram showing a lossless decoding apparatus for restoring the bitstream output from the lossless encoding apparatus shown in FIG. 1 and perhaps stored on a recording medium such as a DVD. In FIG. 4, an input buffer 41 stores bitstream data generated in the encoding apparatus of FIG. 1 in the same sequence as its input sequence. A buffer controller 43 controls the input buffer 41 in order to output the data stored in the input buffer 41 to a lossless restorer 45. Under the control of the buffer controller 43, the second data is output to the lossless restorer 45 without change, and the fourth data is combined with the third data corresponding to the fourth data, based on identification information added to the third data and the fourth data. The combined first data is output to the lossless restorer 45. Here, the buffer controller 43 determines the sequence of the first data and the second data both output to the lossless restorer 45 based on the second data and the third data. Thus, in the case that the second data precedes the third data among the data of the bitstream input to the input buffer 41, the second data is output to the lossless restorer 45 and then the first data corresponding to the third data is output to the lossless restorer 45. As a result, the input buffer 41 can supply the stored data to the lossless restorer 45 so that the lossless restorer 45 can restore data without any delay.

The lossless restorer 45 performs a reverse process of a signal processing in the above-described lossless compression unit 13 in order to restore the digital audio data, and outputs the restored audio data to an output buffer 47. The output buffer 47 stores the digital audio data supplied from the lossless restorer 45 and supplies the stored digital audio data to a following device (not shown).

Since it is apparent to those who are skilled in the art that the above lossless encoding apparatus and the above lossless decoding apparatus can be employed in a lossless encoding and decoding system, although it has not been shown in the drawings and described in the specification, a detailed description of such a lossless encoding and decoding system is omitted here.

As described above, the lossless encoding and decoding system including the lossless encoding apparatus and the lossless decoding apparatus controls the bitrate of the encoded audio data so that the encoded audio data can be decoded on a real-time basis. Thus, the present invention can be used in a real-time system with limited bitrate as in a disc playback device or a communications channel.

Although a preferred embodiment of the present invention has been shown and described, it would be appreciated by those skilled in the art that changes may be made in this embodiment without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents. 

What is claimed is:
 1. A method of decoding encoded audio data which has been losslessly compression encoded in a sequence such that, where ones of the data units of the encoded audio data have data amounts in excess of a maximum bitrate, the excess data amounts have been combined with other ones of the data units which have data amounts less than the maximum bitrate, the method comprising: buffering the excess data amounts in a buffer; and combining the buffered excess data amounts with the corresponding ones of the data units originally having the excess data amounts; and outputting the combined and other data units as restored audio data.
 2. The method according to claim 1, wherein the excess data amounts and the corresponding ones of the data units further comprise identification information, said buffering comprises buffering the excess data amounts to be combined with the corresponding ones of the data units using the identification information, and said combining comprises combining the buffered excess data amounts and the corresponding ones of the data units using the identification information.
 3. The method according to claim 2, wherein said outputting the data units comprises outputting the sequence of the data units in which the other data units which have no excess data amounts precede the combined data units combined with the excess data amounts.
 4. The method according to claim 2, wherein said buffering the excess data amounts comprises buffering the excess data amounts to be combined with the corresponding ones of the data units originally having the excess data amounts such that the combined data amounts exceed the maximum bitrate, the corresponding data units originally having the excess data amounts being subsequent in the sequence to the other data units not originally having the excess data amounts and to which the excess data amounts were added during encoding so as to form combined data amounts less than the maximum bitrate.
 5. The method according to claim 1, wherein said outputting the data units comprises outputting the sequence of the data units in which the other data units which have no excess data amounts precede the combined data units combined with the excess data amounts.
 6. The method according to claim 1, wherein said buffering the excess data amounts comprises buffering the excess data amounts to be combined with the corresponding ones of the data units originally having the excess data units such that the combined data amounts exceed the maximum bitrate, the corresponding data units originally having the excess data amounts being subsequent in the sequence to the other data units not originally having the excess data amounts and to which the excess data amounts were added during encoding so as to form combined data amounts that remain less than the maximum bitrate.
 7. A method of decoding losslessly encoded audio data, the losslessly encoded audio data comprising data units less than a predetermined size, the method comprising: buffering a first portion of a first data unit, the first portion comprising encoded audio data added to a first original data unit to create the first data unit; combining the buffered first portion with a second data unit to create a second original data unit, where the first portion was moved during encoding from the second original data unit which exceeded the predetermined size to create the second data unit which is within the predetermined size; and restoring the first and second original data units in a sequence.
 8. The method of claim 7, wherein said restoring the first original data unit is performed during said combining the buffered first portion and the second data unit.
 9. The method of claim 7, further comprising restoring additional data units between said restoring the first and the second original data units.
 10. The method of claim 7, wherein said combining further comprises: detecting identification information in the buffered first portion, detecting identification information in the second data unit, and combining the buffered first portion and the second data unit in accordance with the detected identification information to create the second original data unit.
 11. The method of claim 7, further comprising: receiving the encoded audio data including the first and second data units in the sequence prior to said buffering the first portion and said combining the first portion and the second data unit; buffering the encoded audio data in the sequence; and outputting from the buffered encoded audio data, including the first and second original data, to be restored in the sequence.
 12. A method of decoding losslessly encoded audio data encoded in a sequence, the losslessly encoded audio data comprising data units, the method comprising: buffering a first portion of a first data unit, the first portion comprising audio data added to a first original data unit to create the first data unit; combining the buffered first portion with a second data unit to create a second original data unit, where the first portion was moved from the second original data unit to create the second data unit; and restoring the first and second original data units in the sequence.
 13. The method of claim 12, wherein said restoring the first original data unit is performed during said combining the buffered first portion and the second data unit to create the second original data unit.
 14. The method of claim 13, wherein said combining further comprises: detecting identification information in the first portion, detecting identification information in the second data unit, and combining the buffered first portion and the second data unit in accordance with the detected identification information of the first portion and the second data unit.
 15. The method of claim 13, further comprising: receiving the encoded audio data including the first and second data units in the sequence prior to said buffering the first portion and said combining the first portion and the second data unit; and buffering the encoded audio data in the sequence, wherein said restoring comprises outputting the buffered encoded audio data, including the first and second original data, to be restored in the sequence.
 16. The method of claim 12, further comprising restoring additional data units between said restoring the first original data unit and the second original data unit, first original data unit, additional data units, and the second original data unit being restored in the sequence.
 17. The method of claim 16, wherein said combining further comprises: detecting identification information in the first portion; detecting identification information in the second data unit; and combining the buffered first portion and the second data unit in accordance with the detected identification information of the first portion and the second data unit.
 18. The method of claim 16, further comprising: receiving the encoded audio data including the first and second data units in the sequence prior to said buffering the first portion and said combining the first portion and the second data unit; and buffering said encoded audio data in the sequence, wherein said restoring comprises outputting the buffered encoded audio data, including the first and second original data, to be restored in the sequence.
 19. The method of claim 12, wherein said combining further comprises: detecting identification information in the first portion, detecting identification information in the second data unit; and combining the buffered first portion and the second data unit in accordance with the detected identification information of the first portion and the second data unit.
 20. The method of claim 12, further comprising: receiving the encoded audio data including the first and second data units in the sequence prior to said buffering the first portion and said combining the first portion and the second data unit; and buffering the encoded audio data in the sequence, wherein said restoring comprises outputting the buffered encoded audio data, including the first and second original data units to be restored in the sequence. 